package com.chentf.srb.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author chentengfei
 * @desc gateway启动类
 * @date 2021-11-28 16:35:44
 */
@SpringBootApplication
@EnableDiscoveryClient
public class ServiceGatewayApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(ServiceGatewayApplication.class, args);
        String port = run.getEnvironment().getProperty("server.port");
        String serviceName = run.getEnvironment().getProperty("spring.application.name");
        System.out.println("启动端口为:"+port+",启动服务名为:"+serviceName);
    }
}
